<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3d变形</title>
    <style>
       
        .out{
            height: 2000px;
            width: 2000px;
            position: relative;
            perspective: 1000px;                  
            transform-style: preserve-3d;      
        }
        .box{
            background-color: #ccc;
            width: 200px;
            height: 200px;
            line-height: 200px;
            text-align: center;
            position: absolute;
            border:1px #fff solid;
            opacity: 0.5;
            margin: 200px 200px 200px 200px;
        }  
        .front{
            transform: translateZ(100px);
        }    
        .back{
            transform: translateZ(-100px);
        }
        .left{
            transform:rotateY(90deg) translateZ(-100px);
        }
        .right{
            transform:rotateY(90deg) translateZ(100px);
        }
        .top{
            transform:rotateX(90deg) translateZ(100px);
        }
        .bottom{
            transform:rotateX(90deg) translateZ(-100px);
        }
    </style>
</head>
<body>   
    <div class="out">
        <div class="box front">前面</div>
        <div class="box back">后面</div>
        <div class="box left">左面</div>
        <div class="box right">右面</div>
        <div class="box top">上面</div>
        <div class="box bottom">下面</div>
      
    </div>
</body>
</html>